import settings
from django.conf.urls.defaults import patterns, include, url
from dajaxice.core import dajaxice_autodiscover

# Enable admin
from django.contrib import admin
from shared.views import http404, http500

admin.autodiscover()
dajaxice_autodiscover()

handler404 = http404
handler500 = http500

urlpatterns = patterns('',
    (r'^users/', include('usermanagement.urls')),
    (r'^documents/', include('documents.urls')),
    (r'^upload/', include('upload.urls')),
    (r'^link/', include('link.urls')),
    (r'^mail/', include('mail.urls')),
    
    (r'^$', include('shared.urls')),

    # Enable the admin/doc
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    
    # Enable admin
    url(r'^admin/', include(admin.site.urls)),
    
    (r'^%s/' % settings.DAJAXICE_MEDIA_PREFIX, include('dajaxice.urls')),
)
